﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.general.hrms.manage
{
    public partial class dept : ModulePage
    {


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int deptId = (Request.QueryString["dept_id"] != null) ? int.Parse(Request.QueryString["dept_id"].ToString()) : 0;
                this.ViewState["DeptId"] = deptId;
                DataTable table = new DepartmentDao().SelectByDeptId(base.Conn, deptId);
                if (table.Rows.Count > 0)
                {
                    this.litDeptName.Text = this.litDeptName2.Text = table.Rows[0]["DeptName"].ToString();
                }
                DataTable table2 = new HrmsDao().SelectByDeptId(base.Conn, deptId);
                if (table2.Rows.Count > 0)
                {
                    this.rptHrms.DataSource = table2;
                    this.rptHrms.DataBind();
                    this.litUserNums.Text = table2.Rows.Count.ToString();
                }
                else
                {
                    this.litUserNums.Text = "0";
                    this.litMessage.Text = base.ShowMessage("尚未定义学生档案信息");
                }
            }
        }

    }
}
